home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume10 / gb3 / patch2a < prev    next >
Encoding:
Internet Message Format  |  1990-08-28  |  57.9 KB

  1. Path: uunet!zephyr.ens.tek.com!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v11i039:  gb3 - Galactic Bloodshed, an empire-like war game [Ver. 2.0], Patch2a
  5. Message-ID: <6226@tekred.CNA.TEK.COM>
  6. Date: 28 Aug 90 19:34:03 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1828
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: VANCLEEF@mps.ohio-state.edu
  12. Posting-number: Volume 11, Issue 39
  13. Archive-name: gb3/Patch2a
  14. Patch-To: gb3: Volume 10, Issue 1-14
  15.  
  16.     [Patch #2 reflects the changes necessary to bring this
  17.      version up to level 1.3.1 client and level 2.2.2 server.
  18.      (Patch #1 was incorporated as part of the original source
  19.      posting.) This set of patches contains diffs for files
  20.      whose diffs were shorter than the source and replacement
  21.      files for those whose diffs were larger than the source.
  22.      Use "patch -p" to apply the diffs in the patches02[a-d]
  23.      files.   -br]
  24.     [I also added a NO_LOG1P flag to the server/Makefile that
  25.      can be defined to get the server to compile on hosts that
  26.      don't have the log1p() function. -br]
  27.  
  28. #! /bin/sh
  29. # This is a shell archive.  Remove anything before this line, then unpack
  30. # it by saving it into a file and typing "sh file".  To overwrite existing
  31. # files, type "sh file -c".  You can also feed this as standard input via
  32. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  33. # will see the following message at the end:
  34. #        "End of archive 1 (of 9)."
  35. # Contents:  Docs/crystal.doc MANIFEST.P2 patches02d server/load.c
  36. # Wrapped by billr@saab on Tue Aug 28 08:54:52 1990
  37. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  38. if test -f 'Docs/crystal.doc' -a "${1}" != "-c" ; then 
  39.   echo shar: Renaming existing file \"'Docs/crystal.doc'\" to \"'Docs/crystal.doc.orig'\"
  40.   mv -f 'Docs/crystal.doc' 'Docs/crystal.doc.orig'
  41. fi
  42. echo shar: Extracting \"'Docs/crystal.doc'\" \(2246 characters\)
  43. sed "s/^X//" >'Docs/crystal.doc' <<'END_OF_FILE'
  44. XCRYSTAL            Galactic Bloodshed            CRYSTAL
  45. X
  46. XCONCEPT
  47. X
  48. X   When the universe is created, some sectors on planets may contain
  49. Xcrystal deposits denoted by a '&'. As long as there are crystals in
  50. Xa sector the symbol remains on the sector. Through their explorations
  51. Xplayers will find sectors that have these deposits although they
  52. Xcan never know exactly how many crystals are hidden in the sector.
  53. X
  54. X   When a player occupies a sector with crystal deposits in them, during
  55. Xthe update, his race will attempt to find crystals. The probability of
  56. Xsuccess per update is equal to the sector efficiency. During an update,
  57. Xthe planet's total crystal production can be determined by setting
  58. Xautoreport. A line telling how many crystals are in the players stockpiles
  59. Xalso will appear on map.
  60. X
  61. X   Crystals are like the other commodities, population, resources, fuel,
  62. Xand destruct. They may be loaded and unloaded from ships as for other
  63. Xcommodities. They may also be captured just like other commodities.
  64. X
  65. X  If a ship with hyper-drive has at least one crystal on board, the player
  66. Xmay mount the crystal into the hyper-drive (see help on the 'mount' 
  67. Xcommand). Only one crystal needs to be mounted. However a player may
  68. Xcarry more if he/she chooses. If a player has a crystal mounted in the
  69. Xhyper-drive, the ship does not need to recharge, it is always considered
  70. Xto be charged for hyper-space jump during the update. The crystal also
  71. Xallows the ship to travel longer distances due to fuel efficiency.
  72. X
  73. X  Crystals in the hyper-drive also allows a player to use laser-beam-
  74. Xlike weapons. These weapons, however, will consume fuel, not destruct
  75. Xto operate. These weapons have the same effect as normal fire, except
  76. Xthere is no limit to how much fuel you may expend in an attack.
  77. X
  78. X  Players should be careful of the amount of fuel they wish to put
  79. Xthrough a crystal at anytime. Crystals may break, rendering them useless,
  80. Xor, in extreme cases, cause the detonation of the ship they are in,
  81. Xalong with everything else nearby.
  82. X
  83. X The maximum safe limit of fuel passing through a crystal is 100 fuel
  84. Xpoints. For every point of fuel passed through above that the crystal
  85. Xstands a 1% chance of breaking and a 1/2% change of blowing up the
  86. Xship!
  87. X
  88. XSEE ALSO
  89. X   mount, fire, order
  90. END_OF_FILE
  91. if test 2246 -ne `wc -c <'Docs/crystal.doc'`; then
  92.     echo shar: \"'Docs/crystal.doc'\" unpacked with wrong size!
  93. fi
  94. # end of 'Docs/crystal.doc'
  95. if test -f 'MANIFEST.P2' -a "${1}" != "-c" ; then 
  96.   echo shar: Renaming existing file \"'MANIFEST.P2'\" to \"'MANIFEST.P2.orig'\"
  97.   mv -f 'MANIFEST.P2' 'MANIFEST.P2.orig'
  98. fi
  99. echo shar: Extracting \"'MANIFEST.P2'\" \(1850 characters\)
  100. sed "s/^X//" >'MANIFEST.P2' <<'END_OF_FILE'
  101. X   File Name        Archive #    Description
  102. X-----------------------------------------------------------
  103. X Docs/beginner.doc          9    
  104. X Docs/crystal.doc           1    
  105. X Docs/detonate.doc          9    
  106. X Docs/dissolve.doc          9    
  107. X Docs/dump.doc              9    
  108. X Docs/lasers.doc            9    
  109. X Docs/motto.doc             9    
  110. X Docs/mount.doc             6    
  111. X Docs/production.doc        9    
  112. X Docs/read.doc              9    
  113. X Docs/repair.doc            9    
  114. X Docs/standby.doc           9    
  115. X Docs/stats.doc             9    
  116. X Docs/victory.doc           4    
  117. X MANIFEST.P2                1    This shipping list
  118. X SETUP                      9    
  119. X client/GB_client.c         7    
  120. X client/client.h            9    
  121. X client/cmd.c               8    
  122. X client/map.c               6    
  123. X patches02a                 4    
  124. X patches02b                 2    
  125. X patches02c                 3    
  126. X patches02d                 1    
  127. X server/build.c             5    
  128. X server/capitol.c           9    
  129. X server/capture.c           8    
  130. X server/config.h            9    
  131. X server/cs.c                8    
  132. X server/declare.c           8    
  133. X server/dissolve.c          9    
  134. X server/dock.c              6    
  135. X server/doship.c            6    
  136. X server/doturn.c            7    
  137. X server/files.h             9    
  138. X server/fire.c              5    
  139. X server/interface.h         9    
  140. X server/land.c              8    
  141. X server/launch.c            8    
  142. X server/load.c              1    
  143. X server/map.c               5    
  144. X server/move.c              7    
  145. X server/moveship.c          7    
  146. X server/name.c              6    
  147. X server/patchlevel.h        2    
  148. X server/power.c             9    
  149. X server/races.h             9    
  150. X server/relation.c          9    
  151. X server/rst.c               7    
  152. X server/scrap.c             8    
  153. X server/shipdata.h          9    
  154. X server/ships.h             8    
  155. X server/tech.c              9    
  156. X server/teleg_send.c        7    
  157. X server/toggle.c            9    
  158. X server/welcome.txt         3    
  159. END_OF_FILE
  160. if test 1850 -ne `wc -c <'MANIFEST.P2'`; then
  161.     echo shar: \"'MANIFEST.P2'\" unpacked with wrong size!
  162. fi
  163. # end of 'MANIFEST.P2'
  164. if test -f 'patches02d' -a "${1}" != "-c" ; then 
  165.   echo shar: Renaming existing file \"'patches02d'\" to \"'patches02d.orig'\"
  166.   mv -f 'patches02d' 'patches02d.orig'
  167. fi
  168. echo shar: Extracting \"'patches02d'\" \(29478 characters\)
  169. sed "s/^X//" >'patches02d' <<'END_OF_FILE'
  170. X*** /usr/cna/billr/games/gb3/Docs/build.doc    Wed May 30 15:11:25 1990
  171. X--- Docs/build.doc    Thu Aug 23 13:28:56 1990
  172. X***************
  173. X*** 38,45 ****
  174. X     If your ship is a factory 'F', you must 'cs' to the factory, and type 'build'. If the 
  175. X  factory is online (turned on via the 'order' command) and has been programmed
  176. X  to build a specific ship design, it will construct the ship in the same sector
  177. X! as the factory. Resources must be available to construct the ship at the
  178. X! planet where the factory is located. See help on the 'make' command and
  179. X  'modify' command for details on ship design. When a factory is turned online
  180. X  via the 'order' command, twice the resource cost of the ship being produced at 
  181. X  the factory will be deducted form the planetary stockpile. Once online, a factory
  182. X--- 38,46 ----
  183. X     If your ship is a factory 'F', you must 'cs' to the factory, and type 'build'. If the 
  184. X  factory is online (turned on via the 'order' command) and has been programmed
  185. X  to build a specific ship design, it will construct the ship in the same sector
  186. X! as the factory. Note that a factory will only attempt to produce a ship if you type
  187. X! 'build'. It will not produce ships on its own. Resources must be available to construct 
  188. X! the ship at the planet where the factory is located. See help on the 'make' command and
  189. X  'modify' command for details on ship design. When a factory is turned online
  190. X  via the 'order' command, twice the resource cost of the ship being produced at 
  191. X  the factory will be deducted form the planetary stockpile. Once online, a factory
  192. X***************
  193. X*** 46,52 ****
  194. X  cannot be turned 'off' (via order). The factory is then committed to producing
  195. X  the class of ships it has been programmed. Players should therefore be warned
  196. X  to make absolutely sure that the ship type and parameters are acceptable before
  197. X! turning the factory online.
  198. X  
  199. X  
  200. X    A player may do 'build ?' for details on the types of ships available at his
  201. X--- 47,55 ----
  202. X  cannot be turned 'off' (via order). The factory is then committed to producing
  203. X  the class of ships it has been programmed. Players should therefore be warned
  204. X  to make absolutely sure that the ship type and parameters are acceptable before
  205. X! turning the factory online. You can give a name to the ship design made by
  206. X! the factory by using 'name class <name>'. This is useful for keeping track
  207. X! of your factories (class names show up with 'stock' reports).
  208. X  
  209. X  
  210. X    A player may do 'build ?' for details on the types of ships available at his
  211. X*** /usr/cna/billr/games/gb3/Docs/capture.doc    Wed May 30 15:11:27 1990
  212. X--- Docs/capture.doc    Thu Aug 23 13:28:58 1990
  213. X***************
  214. X*** 15,23 ****
  215. X  assault. If the sector where the ship is located is occupied by the player, 
  216. X  the combat strengths of the player (attacker) and alien (defender) are
  217. X  computed. The combat strengths depend on number of beings, fighting
  218. X! ability, sector mobilizations, sector terrain and technology of the
  219. X! races as well as ship sizes and armor. The assault is evaluated and casualties 
  220. X! are removed from each defender and attacker.
  221. X  
  222. X      Defense strengths of terrain:
  223. X          land  = 1
  224. X--- 15,28 ----
  225. X  assault. If the sector where the ship is located is occupied by the player, 
  226. X  the combat strengths of the player (attacker) and alien (defender) are
  227. X  computed. The combat strengths depend on number of beings, fighting
  228. X! ability, sector terrain and technology of the races as well as ship sizes 
  229. X! and armor. The assault is evaluated and casualties are removed from each 
  230. X! defender and attacker.
  231. X! 
  232. X!    A player may attack with as many population as the sector contains.
  233. X! If the number of boarders isn't specified, all occupants of the sector
  234. X! will assault the ship.
  235. X! 
  236. X  
  237. X      Defense strengths of terrain:
  238. X          land  = 1
  239. X*** /usr/cna/billr/games/gb3/Docs/fire.doc    Wed May 30 15:11:34 1990
  240. X--- Docs/fire.doc    Thu Aug 23 13:29:08 1990
  241. X***************
  242. X*** 58,63 ****
  243. X--- 58,66 ----
  244. X  evaluated for hit/miss, the sum of all hits is then used to
  245. X  determine the results of the salvo.
  246. X  
  247. X+    If a ship is firing on another ship, and no strength is given, the salvo
  248. X+ strength specified by the player (see 'order salvo <strength>') is used.
  249. X+ 
  250. X     The hit probability depends on several factors
  251. X  
  252. X    1) The technology of firing ship. The higher the technology,
  253. X***************
  254. X*** 107,127 ****
  255. X  
  256. X  
  257. X     After the hit probability is determined each firing gun is
  258. X! evaluated for hit/miss. The total number of hits is then compared
  259. X! to the armor of the defending ship. The armor value of the ship
  260. X! represents the amount of hits per salvo it can absorb without taking 
  261. X! any structural damage at all (exception - see 'critical hits' below).
  262. X! The structural damage to the ship is evaluated by the formula
  263. X  
  264. X!     % damage = 30 * ( hits - armor) / body.
  265. X  
  266. X! If hits <= armor no structural damage is evaluated. Bigger ships
  267. X! (represented by body) can absorb more hits less ensuing damage
  268. X! than little ships. Also notice that smaller ships, although
  269. X! harder to hit, are easier to damage *when* hit.
  270. X  
  271. X  
  272. X  
  273. X     After evaluating for structural damage, the program then checks for
  274. X  'critical hits'. EACH hit is evaluated, whether or not any real
  275. X  structural damage has occured on the target vessel. The chances
  276. X--- 110,140 ----
  277. X  
  278. X  
  279. X     After the hit probability is determined each firing gun is
  280. X! evaluated for hit/miss. Each hit is then checked to for penetration.
  281. X! The probability of a hit penetrating depends on the ships armor:
  282. X  
  283. X!                         armor
  284. X!         penetration probability = factor
  285. X  
  286. X! The armor effectiveness factor is depends on the technology of both
  287. X! the firing and target ship:
  288. X  
  289. X+                 firing ship technology + 1
  290. X+         factor = tanh( ---------------------------- )
  291. X+                 target ship technology + 1
  292. X  
  293. X+ The structural damage to the ship is then evaluated by the formula
  294. X  
  295. X+     % damage = ( 1 + damage_factor) * 40 * penetrated hits / body.
  296. X+ 
  297. X+ Bigger ships (represented by body) can absorb more hits less ensuing 
  298. X+ damage than little ships. Also notice that smaller ships, although
  299. X+ harder to hit, are easier to damage *when* hit.
  300. X+ 
  301. X+ Civilian class ships are easier to damage than military ships. The
  302. X+ 'damage_factor' is 2 for stations, habitats, mirrors and 1 for cargo ships,
  303. X+ tankers, and orbital assault platforms.
  304. X+ 
  305. X     After evaluating for structural damage, the program then checks for
  306. X  'critical hits'. EACH hit is evaluated, whether or not any real
  307. X  structural damage has occured on the target vessel. The chances
  308. X***************
  309. X*** 128,142 ****
  310. X  of a critical hit depends on the size of the target ship.
  311. X  Specifically
  312. X  
  313. X!         critical hit probability = 10 * body : 1.
  314. X  
  315. X  Smaller ships are more likely to suffer damage from critical hits
  316. X! than big ships. As an example, a Battleship with a size of
  317. X! 45 has a 450:1 odds of taking a critical hit from each hit.
  318. X! A fighter group with a size of 10 has a 100:1 odds against such
  319. X! a hit. Note, if you throw LOTS of fire power at an object you
  320. X! may get one. (You can also recall the story of David and Goliath!)
  321. X! Each critical hit is then evaluated. A random amount of damage
  322. X  between 1 and 100% is assessed for each hit, in addition to the 
  323. X  normal structural damage.
  324. X  
  325. X--- 141,153 ----
  326. X  of a critical hit depends on the size of the target ship.
  327. X  Specifically
  328. X  
  329. X!         critical hit probability = size : 1.
  330. X  
  331. X  Smaller ships are more likely to suffer damage from critical hits
  332. X! than big ships. As an example, a Battleship with a size of 30
  333. X! and has a 30:1 odds of taking a critical hit from each pentration.
  334. X! A fighter group with a size of 10 and no armor has a 10:1 odds against 
  335. X! such a hit. Each critical hit is then evaluated. A random amount of damage
  336. X  between 1 and 100% is assessed for each hit, in addition to the 
  337. X  normal structural damage.
  338. X  
  339. X*** /usr/cna/billr/games/gb3/Docs/load.doc    Wed May 30 15:11:39 1990
  340. X--- Docs/load.doc    Thu Aug 23 13:29:15 1990
  341. X***************
  342. X*** 15,22 ****
  343. X  
  344. X    #shipnum -- What ship to load from/to
  345. X  
  346. X!   d|c|r|f -- specify destructive potential, crew, resources, or fuel to load/ 
  347. X! unload.  destructive potential, resources and fuel are taken from that user's
  348. X  stockpiles, while people are taken from the sector the ship is landed on.  If
  349. X  the ship is docked with another ship and not a planet, the tranfers will be 
  350. X  direct.
  351. X--- 15,22 ----
  352. X  
  353. X    #shipnum -- What ship to load from/to
  354. X  
  355. X!   d|c|r|f|x -- specify destructive potential, crew, resources, fuel or crystals to 
  356. X! load/ unload.  destructive potential, resources and fuel are taken from that user's
  357. X  stockpiles, while people are taken from the sector the ship is landed on.  If
  358. X  the ship is docked with another ship and not a planet, the tranfers will be 
  359. X  direct.
  360. X*** /usr/cna/billr/games/gb3/Docs/make.doc    Wed May 30 15:11:39 1990
  361. X--- Docs/make.doc    Thu Aug 23 13:29:16 1990
  362. X***************
  363. X*** 16,22 ****
  364. X     The make with a ship argument can only be issued to offline factories.
  365. X  Once online, the ship design is set.
  366. X  
  367. X!    if no argument is specified, the command will list the characteristics
  368. X  of the ship type being produced. These characteristics can be altered
  369. X  via the 'modify' command.
  370. X  
  371. X--- 16,22 ----
  372. X     The make with a ship argument can only be issued to offline factories.
  373. X  Once online, the ship design is set.
  374. X  
  375. X!    If no argument is specified, the command will list the characteristics
  376. X  of the ship type being produced. These characteristics can be altered
  377. X  via the 'modify' command.
  378. X  
  379. X*** /usr/cna/billr/games/gb3/Docs/modify.doc    Wed May 30 15:11:42 1990
  380. X--- Docs/modify.doc    Thu Aug 23 13:29:20 1990
  381. X***************
  382. X*** 14,20 ****
  383. X  the 'standard' design and a cost for producing the ship is evaluated
  384. X  based on these attributes. Specifically, the following attributes may
  385. X  be altered:
  386. X!     armor, guns, size, crew, fuel, cargo, destruct, speed.
  387. X  
  388. X     The modify command reports the current cost of producing the ship
  389. X  type at the factory. Basically, the cost of producing the ship is 
  390. X--- 14,20 ----
  391. X  the 'standard' design and a cost for producing the ship is evaluated
  392. X  based on these attributes. Specifically, the following attributes may
  393. X  be altered:
  394. X!     armor, guns, size, crew, fuel, cargo, destruct, speed, hyperdrive.
  395. X  
  396. X     The modify command reports the current cost of producing the ship
  397. X  type at the factory. Basically, the cost of producing the ship is 
  398. X***************
  399. X*** 26,31 ****
  400. X--- 26,39 ----
  401. X  For each attribute, if this number is positive it is considered to be an
  402. X  'advantage' and if it is negative, the absolute value of it is considered
  403. X  to be a 'disadvantage'.
  404. X+ 
  405. X+    All ships built at a factory may have hyper-space jump capabilities
  406. X+ by installing 'hyperdrive'. Having this is assumed to be an advantage
  407. X+ of 1.
  408. X+ 
  409. X+    The maximum value by which an attribute may be modified to is dependent
  410. X+ on the technology the factory used to construct the ship by
  411. X+     (max value) = (1 + tech/100) * (standard value)
  412. X  
  413. X     A base mass is also computed, the mass of the ship with nothing loaded 
  414. X  on board. Each point of armor has a mass of 1 while each gun and point 
  415. X*** /usr/cna/billr/games/gb3/Docs/move.doc    Wed May 30 15:11:43 1990
  416. X--- Docs/move.doc    Thu Aug 23 13:29:23 1990
  417. X***************
  418. X*** 11,23 ****
  419. X  
  420. X     This command is used to move population from one sector to an adjacent
  421. X  sector. The player enters the origination sector, target sector, and the
  422. X! amount of population to move. If no population argument is given, all
  423. X! population in the original sector will be moved. If the destination
  424. X! sector is occupied by aliens, the combat strengths of the player (attacker) 
  425. X! and alien (defender) are computed. The combat strengths depend on number of 
  426. X! beings, fighting ability, sector mobilizations, sector terrain and technology 
  427. X! of the races. The assault is evaluated and casualties are removed from
  428. X! each sector.
  429. X  
  430. X     If mesomorphic races are involved in the combat, and are victorious,
  431. X  by either taking the assaulted sector or repulsing an attack, they may
  432. X--- 11,27 ----
  433. X  
  434. X     This command is used to move population from one sector to an adjacent
  435. X  sector. The player enters the origination sector, target sector, and the
  436. X! amount of population to move. If the destination sector is occupied by 
  437. X! aliens, the combat strengths of the player (attacker) and alien (defender) 
  438. X! are computed. The combat strengths depend on number of beings, fighting 
  439. X! ability, sector terrain and technology of the races. The assault is evaluated 
  440. X! and casualties are removed from each sector.
  441. X! 
  442. X!    If no population argument is given, all population in the original sector 
  443. X! will be moved. If a negative population is specified, the all population,
  444. X! except for the amount specified, will move. For example, 'move 2,3 3,3 -5'
  445. X! will move all population from sector 2,3 to sector 3,3, except for 5 which
  446. X! remain behind.
  447. X  
  448. X     If mesomorphic races are involved in the combat, and are victorious,
  449. X  by either taking the assaulted sector or repulsing an attack, they may
  450. X*** /usr/cna/billr/games/gb3/Docs/name.doc    Wed May 30 15:11:43 1990
  451. X--- Docs/name.doc    Thu Aug 23 13:29:24 1990
  452. X***************
  453. X*** 14,19 ****
  454. X--- 14,23 ----
  455. X  You can also rename your race with 'name race <name>'. You must own the
  456. X  ship or have explored the star or planet to rename them.
  457. X  
  458. X+   To name the clkass of ships being produced by a factory, you use 'name class
  459. X+ <name>'. The factory must be off-line for this to work.
  460. X+ 
  461. X+ 
  462. X    An additional constraint against the player is that he have more AP's
  463. X  than any other player in the system in which he is naming (only if the
  464. X  object is a star).  The AP cost will be deducted from that system,
  465. X*** /usr/cna/billr/games/gb3/Docs/order.doc    Wed May 30 15:11:49 1990
  466. X--- Docs/order.doc    Thu Aug 23 13:29:34 1990
  467. X***************
  468. X*** 31,37 ****
  469. X      Syntax: order <shipnumber> destination <destination>
  470. X  
  471. X  
  472. X!   speed -- Change the speed of a ship. All speed factors are between 0 and 4.
  473. X      Higher speeds used fuel less efficiently than lower speeds.
  474. X      Syntax: order <shipnumber> speed <speed factor>
  475. X  
  476. X--- 31,37 ----
  477. X      Syntax: order <shipnumber> destination <destination>
  478. X  
  479. X  
  480. X!   speed -- Change the speed of a ship. All speed factors are between 0 and 9.
  481. X      Higher speeds used fuel less efficiently than lower speeds.
  482. X      Syntax: order <shipnumber> speed <speed factor>
  483. X  
  484. X***************
  485. X*** 81,89 ****
  486. X      retaliate -- normally, if a ship is attacked and suffers damage, it
  487. X      and all ships assigned to protect will immediately retaliate
  488. X      with one salvo against the violating ships. A ship can also
  489. X!     be order *not* to retaliate
  490. X      Syntax: order <shipnumber> retaliate <on or off>
  491. X  
  492. X      navigate -- while this is on the destination described above is 
  493. X      ignored and instead, the ship will travel in the direction
  494. X      specified by the course. The directions are specified with
  495. X--- 81,97 ----
  496. X      retaliate -- normally, if a ship is attacked and suffers damage, it
  497. X      and all ships assigned to protect will immediately retaliate
  498. X      with one salvo against the violating ships. A ship can also
  499. X!     be order *not* to retaliate.
  500. X      Syntax: order <shipnumber> retaliate <on or off>
  501. X  
  502. X+     laser -- If this is set, the ship will use it's combat lasers to attack
  503. X+     with instead of normal fire. The player must specify how many
  504. X+     strength points will fire upon retaliation (or default fire power).
  505. X+     For ever point of strength, a laser used 2 fuel points instead
  506. X+     destruct for the attack. The ship must have lasers mounted as
  507. X+     well as a crystal in the hyperdrive.
  508. X+     Syntax: order <shipnumber> laser <on or off> <default strength>
  509. X+ 
  510. X      navigate -- while this is on the destination described above is 
  511. X      ignored and instead, the ship will travel in the direction
  512. X      specified by the course. The directions are specified with
  513. X***************
  514. X*** 102,107 ****
  515. X--- 110,119 ----
  516. X      specified protect will be turned off.
  517. X      Syntax: order <shipnumber> protect <ship to protect>
  518. X  
  519. X+     salvo -- This allows players to control the strength of their
  520. X+     retaliate/defense/protect response.  By default it is set
  521. X+     to the number of guns of the ship.
  522. X+     Syntax: order <shipnumber> salvo <number of guns>
  523. X  
  524. X      defense -- If this is set 'on' it will retaliate
  525. X      if the planet that it is in orbit around or landed on is
  526. X***************
  527. X*** 112,123 ****
  528. X      switch -- Turn mines and transporters on or off.
  529. X      Syntax: order <shipnumber> switch
  530. X  
  531. X!     explosive -- If the ship is a mine, this command sets it to be in explosive 
  532. X!     mode which can damage ships.
  533. X      Syntax: order <shipnumber> explosive
  534. X  
  535. X!     radiative --  Similar to the previous command.  Radiation mines incapacitate 
  536. X!     ships caught in the trigger radius.
  537. X      Syntax: order <shipnumber> radiative
  538. X  
  539. X      move  -- If the ship is a terraforming device, the direction it
  540. X--- 124,135 ----
  541. X      switch -- Turn mines and transporters on or off.
  542. X      Syntax: order <shipnumber> switch
  543. X  
  544. X!     explosive -- If the ship is a mine or a gamma ray laser, this command sets 
  545. X!     it to be in explosive mode which can damage ships.
  546. X      Syntax: order <shipnumber> explosive
  547. X  
  548. X!     radiative --  Similar to the previous command.  Radiation mines and 
  549. X!     gamma ray lasers incapacitate ships.
  550. X      Syntax: order <shipnumber> radiative
  551. X  
  552. X      move  -- If the ship is a terraforming device, the direction it
  553. X*** /usr/cna/billr/games/gb3/Docs/report.doc    Wed May 30 15:11:54 1990
  554. X--- Docs/report.doc    Thu Aug 23 13:29:43 1990
  555. X***************
  556. X*** 20,24 ****
  557. X  
  558. X  
  559. X  SEE ALSO
  560. X!   examine, ship, stock, tactical, scope
  561. X  
  562. X--- 20,24 ----
  563. X  
  564. X  
  565. X  SEE ALSO
  566. X!   examine, ship, stock, tactical, scope, stats
  567. X  
  568. X*** /usr/cna/billr/games/gb3/Docs/ship.doc    Wed May 30 15:11:55 1990
  569. X--- Docs/ship.doc    Thu Aug 23 13:29:45 1990
  570. X***************
  571. X*** 20,24 ****
  572. X  
  573. X  
  574. X  SEE ALSO
  575. X!   examine, report, tactical, scope
  576. X  
  577. X--- 20,24 ----
  578. X  
  579. X  
  580. X  SEE ALSO
  581. X!   examine, report, tactical, scope, stats
  582. X  
  583. X*** /usr/cna/billr/games/gb3/Docs/survey.doc    Wed May 30 15:11:58 1990
  584. X--- Docs/survey.doc    Thu Aug 23 13:29:50 1990
  585. X***************
  586. X*** 68,71 ****
  587. X     Same as the command 'ship #n'
  588. X  
  589. X  SEE ALSO
  590. X!    ship, report, map, weapons, mobilize
  591. X--- 68,71 ----
  592. X     Same as the command 'ship #n'
  593. X  
  594. X  SEE ALSO
  595. X!    ship, report, map, weapons, mobilize, production
  596. X*** /usr/cna/billr/games/gb3/Docs/tactical.doc    Wed May 30 15:11:59 1990
  597. X--- Docs/tactical.doc    Thu Aug 23 13:29:51 1990
  598. X***************
  599. X*** 24,28 ****
  600. X  
  601. X  
  602. X  SEE ALSO
  603. X!   report, stock, scope
  604. X  
  605. X--- 24,28 ----
  606. X  
  607. X  
  608. X  SEE ALSO
  609. X!   report, stock, scope, stats
  610. X  
  611. X*** /usr/cna/billr/games/gb3/Docs/technology.doc    Wed May 30 15:11:59 1990
  612. X--- Docs/technology.doc    Thu Aug 23 13:29:52 1990
  613. X***************
  614. X*** 17,23 ****
  615. X  production.  As you increase the quota on one planet, you will notice, the
  616. X  actual tech production increases less and less; thus, it is important to have
  617. X  a wider cultural base (lots of planets) for better tech development.
  618. X! The tech growth per planet is 0.10*log10(1+investment)/turn.
  619. X  
  620. X  SEE ALSO
  621. X       profile
  622. X--- 17,29 ----
  623. X  production.  As you increase the quota on one planet, you will notice, the
  624. X  actual tech production increases less and less; thus, it is important to have
  625. X  a wider cultural base (lots of planets) for better tech development.
  626. X! 
  627. X!     The additional technology increase per update for a planet is given by
  628. X! a rather complex formula :
  629. X! 
  630. X!     tech = 0.005 *  sqrt(investment * SCALE)
  631. X! 
  632. X! where SCALE = population/1000.
  633. X  
  634. X  SEE ALSO
  635. X       profile
  636. X*** /usr/cna/billr/games/gb3/Docs/telegram.doc    Wed May 30 15:12:00 1990
  637. X--- Docs/telegram.doc    Thu Aug 23 13:29:53 1990
  638. X***************
  639. X*** 1,4 ****
  640. X! TELGRAM            Galactic Bloodshed        TELGRAM
  641. X  
  642. X  
  643. X  CONCEPT
  644. X--- 1,4 ----
  645. X! TELEGRAM            Galactic Bloodshed        TELEGRAM
  646. X  
  647. X  
  648. X  CONCEPT
  649. X***************
  650. X*** 11,22 ****
  651. X  DESCRIPTION
  652. X    
  653. X    This command allows users to communicate with each other.  The player
  654. X! must specify who/what they wish to contact, and a message to send to
  655. X! that player.  To specify a place instead of a single player, the string
  656. X! must begin with one of the following characters: / : . #  If the string
  657. X! is specified in this way, all players that currently occupy the area 
  658. X! specified will be sent the telegram.  If the area is a ship, only the owner
  659. X! of that ship will be the recipient.
  660. X  
  661. X     You can send a message to all members of your alliance block if you
  662. X  use the string 'block' for <player>.
  663. X--- 11,18 ----
  664. X  DESCRIPTION
  665. X    
  666. X    This command allows users to communicate with each other.  The player
  667. X! must specify who they wish to contact, and a message to send to
  668. X! that player.  
  669. X  
  670. X     You can send a message to all members of your alliance block if you
  671. X  use the string 'block' for <player>.
  672. X*** /usr/cna/billr/games/gb3/Docs/time.doc    Wed May 30 15:12:00 1990
  673. X--- Docs/time.doc    Thu Aug 23 13:29:54 1990
  674. X***************
  675. X*** 1,16 ****
  676. X! TIME            Galactic Bloodshed            TIME
  677. X  
  678. X  
  679. X  NAME
  680. X!   [0] time -- give player information of the time for game functions.
  681. X  
  682. X  SYNTAX
  683. X!      time
  684. X  
  685. X  DESCRIPTION
  686. X    
  687. X!     This command tells the player the current local time, the time of the
  688. X! last update and when the server was last started.
  689. X  
  690. X  
  691. X  
  692. X--- 1,33 ----
  693. X! TIME                 Galactic Bloodshed            TIME
  694. X  
  695. X  
  696. X  NAME
  697. X!   [0] time -- give player information of the time for game functions/allocate
  698. X!     more time for daily allotments.
  699. X  
  700. X  SYNTAX
  701. X!      time <allocation>
  702. X  
  703. X  DESCRIPTION
  704. X    
  705. X!     If no argument is given, this command tells the player the current local time,
  706. X! the time of the last update, when the server was last started, as well as current
  707. X! time allotments.
  708. X  
  709. X+    If an argument is given, the designated number of minutes will be subtracted
  710. X+ from weekly time allotments and added to the daily time allotment.
  711. X  
  712. X+    Each player is entitled to 3 hours (180 minutes) login time per day, 
  713. X+ as well as having a pool of 5 hours (300 minutes) of time which can be 
  714. X+ allocated per week. Daily time allotments are reset at the midnight update, 
  715. X+ and weekly time allotments are reset on the midnight update on the 7th, 14th, 
  716. X+ 21st and 28th of each month. Time is not counted when in standby mode. In 
  717. X+ standby mode, however, players may not issue active commands.
  718. X  
  719. X+    If a player's daily time allotment goes to zero, or is in standby mode, the 
  720. X+ player may no longer issue and active commands (commands which alter the 
  721. X+ game data base or do intelligence gathering), but may still use communications
  722. X+ commands.
  723. X+ 
  724. X+ SEE ALSO
  725. X+     standby
  726. X*** /usr/cna/billr/games/gb3/Docs/toggle.doc    Wed May 30 15:12:02 1990
  727. X--- Docs/toggle.doc    Thu Aug 23 13:29:54 1990
  728. X***************
  729. X*** 6,11 ****
  730. X--- 6,12 ----
  731. X  
  732. X  SYNOPSIS
  733. X         toggle <option_name>
  734. X+        highlight <player>
  735. X  
  736. X  DESCRIPTION
  737. X    
  738. X***************
  739. X*** 12,19 ****
  740. X     Toggle turns on or off the named option.  If no option is given,
  741. X  toggle will list all available options and their values.
  742. X  
  743. X!    Currently the only options available deal with the "map" command.
  744. X  
  745. X  SEE ALSO
  746. X!    map
  747. X  
  748. X--- 13,29 ----
  749. X     Toggle turns on or off the named option.  If no option is given,
  750. X  toggle will list all available options and their values.
  751. X  
  752. X!    Options :
  753. X!         gag        will turn off global broadcasts and login/logout
  754. X!         inverse        whether or not to use reverse video
  755. X!         double_digits    display aliens numbers with double digits
  756. X!         geography    if set, playernumbers will not be displayed
  757. X!         autoload    if set, full crew and fuel will be loaded after
  758. X!                             building a new ship
  759. X  
  760. X+    A player can specify which players he/she wishes to highlight.
  761. X+ It is initially set to the player.
  762. X+ 
  763. X  SEE ALSO
  764. X!    map, load, broadcast
  765. X  
  766. X*** /usr/cna/billr/games/gb3/Docs/toxicity.doc    Wed May 30 15:12:02 1990
  767. X--- Docs/toxicity.doc    Thu Aug 23 13:29:55 1990
  768. X***************
  769. X*** 1,11 ****
  770. X! TOXICTY            Galactic Bloodshed            TOXICTY
  771. X  
  772. X  
  773. X  NAME
  774. X    [1] toxicity -- set threshold for building toxic waste canisters
  775. X  
  776. X! SYNOPSIS
  777. X!        toxicity
  778. X  
  779. X  DESCRIPTION
  780. X  
  781. X--- 1,11 ----
  782. X! TOXICITY            Galactic Bloodshed               TOXICITY
  783. X  
  784. X  
  785. X  NAME
  786. X    [1] toxicity -- set threshold for building toxic waste canisters
  787. X  
  788. X! SYNTAX
  789. X!        toxicity <threshold>
  790. X  
  791. X  DESCRIPTION
  792. X  
  793. X*** /usr/cna/billr/games/gb3/client/keyboard.c    Tue May 15 11:31:16 1990
  794. X--- client/keyboard.c    Thu Aug 23 13:37:31 1990
  795. X***************
  796. X*** 116,123 ****
  797. X      int             count;
  798. X  
  799. X      count = read(0, &ch, 1);/* Read from stdin. */
  800. X!     if (count == 0)        /* Huh?  Ignore this. */
  801. X!         return;
  802. X  
  803. X      if (count == -1) {
  804. X          if (errno == EWOULDBLOCK)
  805. X--- 116,123 ----
  806. X      int             count;
  807. X  
  808. X      count = read(0, &ch, 1);/* Read from stdin. */
  809. X!     /*if (count == 0)        /* Huh?  Ignore this. */
  810. X!         /*return;*/
  811. X  
  812. X      if (count == -1) {
  813. X          if (errno == EWOULDBLOCK)
  814. X***************
  815. X*** 163,173 ****
  816. X  
  817. X  process_buffer()
  818. X  {
  819. X!     if (keyboard_pos == 0)    /* Nothing typed. */
  820. X!         return;
  821. X  
  822. X      keyboard_buffer[keyboard_pos] = '\n';
  823. X!     transmit(keyboard_buffer, keyboard_pos + 1);
  824. X  /*    log_input(keyboard_buffer);*/
  825. X  }
  826. X  
  827. X--- 163,177 ----
  828. X  
  829. X  process_buffer()
  830. X  {
  831. X!     /*if (keyboard_pos == 0)    /* Nothing typed. */
  832. X!     /*    return;*/
  833. X  
  834. X      keyboard_buffer[keyboard_pos] = '\n';
  835. X! 
  836. X!         /* check for client command ('source') */
  837. X!     if (!client_cmd(keyboard_buffer))
  838. X!         transmit(keyboard_buffer, keyboard_pos + 1);
  839. X! 
  840. X  /*    log_input(keyboard_buffer);*/
  841. X  }
  842. X  
  843. X*** /usr/cna/billr/games/gb3/client/orbit.c    Tue May 15 11:31:18 1990
  844. X--- client/orbit.c    Thu Aug 23 13:37:33 1990
  845. X***************
  846. X*** 33,38 ****
  847. X--- 33,40 ----
  848. X  extern int    have_inv;
  849. X  
  850. X  float           Lastx, Lasty, Zoom;
  851. X+ char temp[2048];
  852. X+     string        blob;
  853. X  
  854. X  plot_orbit(t)
  855. X      char           *t;
  856. X***************
  857. X*** 40,48 ****
  858. X      int             x, y, array;
  859. X      int             stand1, stand2;
  860. X      char           *u, *v;
  861. X!     char            temp[1024], symbol;
  862. X      int        more_data = 1;
  863. X-     string        blob;
  864. X  
  865. X  
  866. X      clear();
  867. X--- 42,49 ----
  868. X      int             x, y, array;
  869. X      int             stand1, stand2;
  870. X      char           *u, *v;
  871. X!     char            /*temp[1024],*/ symbol;
  872. X      int        more_data = 1;
  873. X  
  874. X  
  875. X      clear();
  876. X***************
  877. X*** 51,57 ****
  878. X      while (more_data) {
  879. X          while ((v = index(u, ';')) != NULL) {
  880. X          *v = 0;
  881. X!         sscanf(u, "%d %d %d %d %1s %d %s", &stand1, &x, &y, &array,
  882. X                 &symbol, &stand2, temp);
  883. X          x = (int) x * Midx;
  884. X          y = (int) y * Midy;
  885. X--- 52,58 ----
  886. X      while (more_data) {
  887. X          while ((v = index(u, ';')) != NULL) {
  888. X          *v = 0;
  889. X!         sscanf(u, "%d %d %d %d %c %d %s", &stand1, &x, &y, &array,
  890. X                 &symbol, &stand2, temp);
  891. X          x = (int) x * Midx;
  892. X          y = (int) y * Midy;
  893. X***************
  894. X*** 62,79 ****
  895. X              } else if (symbol == '*' && array > 0) {    /* nova */
  896. X                  DispArray(x, y, 11, 7, Novae[array - 1], 1.0);
  897. X              }
  898. X!             if (stand1 * have_inv)
  899. X                  standout();
  900. X              mvaddch(y, x, symbol);
  901. X!             if (stand1 * have_inv)
  902. X                  standend();
  903. X              if (symbol == '@' || symbol == '*') {
  904. X                  addstr(" ");
  905. X              }
  906. X!             if (stand2 * have_inv)
  907. X                  standout();
  908. X              addstr(temp);
  909. X!             if (stand2 * have_inv)
  910. X                  standend();
  911. X          }
  912. X          u = v + 1;
  913. X--- 63,80 ----
  914. X              } else if (symbol == '*' && array > 0) {    /* nova */
  915. X                  DispArray(x, y, 11, 7, Novae[array - 1], 1.0);
  916. X              }
  917. X!             if (stand1 && have_inv)
  918. X                  standout();
  919. X              mvaddch(y, x, symbol);
  920. X!             if (stand1 && have_inv)
  921. X                  standend();
  922. X              if (symbol == '@' || symbol == '*') {
  923. X                  addstr(" ");
  924. X              }
  925. X!             if (stand2 && have_inv)
  926. X                  standout();
  927. X              addstr(temp);
  928. X!             if (stand2 && have_inv)
  929. X                  standend();
  930. X          }
  931. X          u = v + 1;
  932. X***************
  933. X*** 95,100 ****
  934. X--- 96,102 ----
  935. X          }
  936. X      }
  937. X  
  938. X+     move(S_Y-1,0);
  939. X      refresh();
  940. X      return;
  941. X  }
  942. X*** /usr/cna/billr/games/gb3/client/patchlevel.h    Thu May 31 08:49:50 1990
  943. X--- client/patchlevel.h    Thu Aug 23 13:45:08 1990
  944. X***************
  945. X*** 1 ****
  946. X! #define PATCHLEVEL    1
  947. X--- 1 ----
  948. X! #define PATCHLEVEL    2
  949. X*** /usr/cna/billr/games/gb3/README_ORIG    Wed May 30 15:10:28 1990
  950. X--- README_ORIG    Wed Aug 22 11:42:01 1990
  951. X***************
  952. X*** 1,3 ****
  953. X--- 1,6 ----
  954. X+ (Note: This is the README which came along with GB .975 in April 1989 -
  955. X+     It is currently outdated and is included for historical interest only - G.vC)
  956. X+ 
  957. X  
  958. X      This is a game of interstellar exploration/conquest.  By the time I
  959. X  realized there really wasn't going to be much fighting going on in the game, I
  960. X*** /usr/cna/billr/games/gb3/README    Fri Jun  1 11:52:49 1990
  961. X--- README    Thu Aug 23 14:00:15 1990
  962. X***************
  963. X*** 32,38 ****
  964. X  then tells the server to do an update. The default update time is 4 hours, 
  965. X  but you can change that with 'GB_daemon <hours between updates>'. It is a 
  966. X  good idea to make your update times a factor of 24 hours. If you want to
  967. X! force an update just do 'GB_doturn' by itself.
  968. X  
  969. X  Players cannot enroll by themselves in this version. The game's host
  970. X  must do that by running 'GB_enroll' and following the instructions. It
  971. X--- 32,38 ----
  972. X  then tells the server to do an update. The default update time is 4 hours, 
  973. X  but you can change that with 'GB_daemon <hours between updates>'. It is a 
  974. X  good idea to make your update times a factor of 24 hours. If you want to
  975. X! force an update just telnet to the server and enter the update password.
  976. X  
  977. X  Players cannot enroll by themselves in this version. The game's host
  978. X  must do that by running 'GB_enroll' and following the instructions. It
  979. X***************
  980. X*** 71,73 ****
  981. X--- 71,81 ----
  982. X  Bill Randle
  983. X  billr@saab.CNA.TEK.COM
  984. X  6/1/90
  985. X+ 
  986. X+ 
  987. X+ Patchlevel 2 reflects the changes necessary to bring this version up
  988. X+ to level 1.3.1 client and level 2.2.2 server.
  989. X+ 
  990. X+ Bill Randle
  991. X+ billr@saab.CNA.TEK.COM
  992. X+ 8/24/90
  993. END_OF_FILE
  994. if test 29478 -ne `wc -c <'patches02d'`; then
  995.     echo shar: \"'patches02d'\" unpacked with wrong size!
  996. fi
  997. # end of 'patches02d'
  998. if test -f 'server/load.c' -a "${1}" != "-c" ; then 
  999.   echo shar: Renaming existing file \"'server/load.c'\" to \"'server/load.c.orig'\"
  1000.   mv -f 'server/load.c' 'server/load.c.orig'
  1001. fi
  1002. echo shar: Extracting \"'server/load.c'\" \(20187 characters\)
  1003. sed "s/^X//" >'server/load.c' <<'END_OF_FILE'
  1004. X/*
  1005. X * Galactic Bloodshed, copyright (c) 1989 by Robert P. Chansky, 
  1006. X * smq@ucscb.ucsc.edu, mods by people in GB_copyright.h.
  1007. X * Restrictions in GB_copyright.h.
  1008. X *
  1009. X *  load.c -- load/unload stuff
  1010. X */
  1011. X
  1012. X#include "GB_copyright.h"
  1013. X#define EXTERN extern
  1014. X#include "vars.h"
  1015. X#include "ships.h"
  1016. X#include "races.h"
  1017. X#include "buffers.h"
  1018. X#include <signal.h>
  1019. X
  1020. Xint load_shdata,load_pdata,load_sectdata, load_racedata, load_stardata;
  1021. X
  1022. X
  1023. Xload(Playernum,APcount, argn,args, mode)
  1024. Xint Playernum;
  1025. Xint APcount;
  1026. Xint argn;
  1027. Xint mode; /* mode = 0 load, mode =1 unload */
  1028. Xchar args[MAXARGS][COMMANDSIZE];
  1029. X{
  1030. Xboolean sh=0,diff=0;
  1031. Xint first=1,proc,Mod=0,lolim,uplim, shipno,amt;
  1032. Xint test;
  1033. Xint transfercrew;
  1034. Xchar commod, buff[128], bufr[128], bufd[128], bufc[128], bufx[128];
  1035. Xshiptype *s,*s2;
  1036. Xplanettype *p;
  1037. Xsectortype *sect;
  1038. Xracetype *Race;
  1039. X
  1040. X    load_shdata = load_pdata = load_sectdata = NEUTRAL_FD;
  1041. X
  1042. X    sscanf(args[1]+(args[1][0]=='#'),"%d",&shipno);
  1043. X
  1044. X    openshdata(&load_shdata);
  1045. Xif (!getship(load_shdata,&s,shipno)) {
  1046. X    close_file(load_shdata);
  1047. X    return;
  1048. X    }
  1049. Xclose_file(load_shdata);
  1050. Xif (s->owner!=Playernum || !s->is_alive) {
  1051. X    DontOwnErr(Playernum,shipno);
  1052. X    free(s);
  1053. X    return;
  1054. X    }
  1055. X    if (!s->active) {
  1056. X    sprintf(buf,"%s #%d is irradiated and inactive.\n", Shipnames[s->type],shipno);
  1057. X        notify(Playernum, buf);
  1058. X    free(s);
  1059. X    return;
  1060. X    }
  1061. X
  1062. X
  1063. X    if (s->whatorbits==LEVEL_UNIV) {
  1064. X        if (!enufAP(Playernum,Sdata.AP[Playernum-1], APcount)) {
  1065. X        free(s);
  1066. X        return;
  1067. X        }
  1068. X    } else if (!enufAP(Playernum,Stars[s->storbits]->AP[Playernum-1], APcount)) {
  1069. X        free(s);
  1070. X        return;
  1071. X    }
  1072. X
  1073. X   
  1074. X    proc = 0;
  1075. X
  1076. X    if (s->type == OTYPE_TRANSDEV && s->object.number > 0) {
  1077. X    openshdata(&load_shdata);
  1078. X    if (!getship(load_shdata,&s2, s->object.number)) {
  1079. X        sprintf(buf,"The hopper seems to be blocked.\n");
  1080. X        notify(Playernum, buf);
  1081. X        close_file(load_shdata);
  1082. X        free(s);
  1083. X        return;
  1084. X    }
  1085. X    close_file(load_shdata);
  1086. X    if (!s2->is_alive) {
  1087. X        sprintf(buf,"The target device does not exist.\n");
  1088. X        notify(Playernum, buf);
  1089. X        free(s);
  1090. X        free(s2);
  1091. X        return;
  1092. X    }
  1093. X    if (s2->type!=OTYPE_TRANSDEV || !s2->on) {
  1094. X    sprintf(buf,"s2->type = %d\n",s2->type);
  1095. X        notify(Playernum, buf);
  1096. X    sprintf(buf,"OTYPE_TRANSDEV = %d\n",OTYPE_TRANSDEV);
  1097. X        notify(Playernum, buf);
  1098. X
  1099. X    sprintf(buf,"s2->on = %d\n",s2->on);
  1100. X        notify(Playernum, buf);
  1101. X        sprintf(buf,"The target device is not receiving.\n");
  1102. X        notify(Playernum, buf);
  1103. X    free(s);
  1104. X    free(s2);
  1105. X    return;
  1106. X    }
  1107. X    } else if (!s->is_docked) {
  1108. X    if (s->type==OTYPE_TRANSDEV) {
  1109. X        sprintf(buf,"It does not seem to work in zero-g environments.\n");
  1110. X        notify(Playernum, buf);
  1111. X        free(s);
  1112. X        return;
  1113. X    }
  1114. X    sprintf(buf,"%s #%d is not landed.\n",is_object(s)?"object":"ship",shipno);
  1115. X        notify(Playernum, buf);
  1116. X        free(s);
  1117. X        return;
  1118. X    } else {
  1119. X    if (s->whatdest==LEVEL_PLAN)
  1120. X        {
  1121. X        sprintf(buf,"Ship #%d at %.0f,%.0f\n", shipno, s->xpos, s->ypos);
  1122. X        notify(Playernum, buf);
  1123. X              if(s->storbits != Dir[Playernum-1].snum || s->pnumorbits != Dir[Playernum-1].pnum)
  1124. X                    {
  1125. X                    sprintf(buf,"Wrong scope!\n");
  1126. X                    notify(Playernum, buf);
  1127. X                    free(s);
  1128. X                    return;
  1129. X                    }
  1130. X        } else {
  1131. X            openshdata(&load_shdata);
  1132. X        if (!getship(load_shdata, &s2, s->destshipno) 
  1133. X            || !s2->is_alive 
  1134. X            || !s->object.number4 &&
  1135. X              !(s2->is_docked && s2->whatdest==LEVEL_SHIP 
  1136. X              && s2->destshipno==shipno) ) {
  1137. X                /* the ship it was docked with died or
  1138. X                   undocked with it or something. */
  1139. X            s->is_docked = 0;
  1140. X            s->whatdest = LEVEL_UNIV;
  1141. X            putship(load_shdata, s, shipno);
  1142. X            close_file(load_shdata);
  1143. X            sprintf(buf,"ship #%u is not docked.\n", s->destshipno);
  1144. X                notify(Playernum, buf);
  1145. X            free(s);
  1146. X            free(s2);
  1147. X            return;
  1148. X            }
  1149. X        close(load_shdata);
  1150. X        sprintf(buf,"Ship #%d docked with %s #%d\n", shipno, 
  1151. X                Shipnames[s2->type], s->destshipno);
  1152. X            notify(Playernum, buf);
  1153. X        sh = 1;
  1154. X        if (s2->owner!=Playernum) {
  1155. X            sprintf(buf,"Player %d owns that ship.\n", s2->owner);
  1156. X                notify(Playernum, buf);
  1157. X            diff = 1;
  1158. X        }
  1159. X    }
  1160. X    }
  1161. X
  1162. Xcommod = args[2][0];
  1163. X    if(argn>3)
  1164. X            amt = atoi(args[3]);
  1165. X    else
  1166. X            amt = 0;
  1167. X
  1168. X    if(mode) amt = -amt;    /* unload */
  1169. X    
  1170. X    if (!sh) {
  1171. X        openpdata(&load_pdata);
  1172. X        getplanet(load_pdata,&p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
  1173. X    close_file(load_pdata);
  1174. X    }
  1175. X
  1176. X       if (!sh && commod=='c') {
  1177. X        opensectdata(&load_sectdata);
  1178. X        getsector(load_sectdata, §, p->sectormappos 
  1179. X            + ( (int)s->ypos*p->Maxx+(int)s->xpos) * sizeof(sectortype) );
  1180. X    close_file(load_sectdata);
  1181. X    }
  1182. X
  1183. X    switch (commod) {
  1184. X
  1185. X    case 'x' :
  1186. X    case '&' : 
  1187. X            if (sh) {
  1188. X                uplim = diff ? 0 : MIN(s2->crystals, Max_crystals(s) - s->crystals);
  1189. X            lolim = diff ? 0 : - MIN(s->crystals, Max_crystals(s2) - s2->crystals);
  1190. X            } else {
  1191. X                uplim = MIN(p->info[Playernum-1].crystals, Max_crystals(s) - s->crystals);
  1192. X            lolim = -s->crystals;
  1193. X            }
  1194. X          proc = 1;
  1195. X          break;
  1196. X
  1197. X    case 'c': 
  1198. X            if (sh) {
  1199. X                uplim = diff ? 0 : MIN(s2->popn, Max_crew(s) - s->popn);
  1200. X            lolim = diff ? 0 : - MIN(s->popn, Max_crew(s2) - s2->popn);
  1201. X            } else {
  1202. X                uplim = MIN(sect->popn, Max_crew(s) - s->popn);
  1203. X            lolim = -s->popn;
  1204. X            }
  1205. X          proc = 1;
  1206. X          break;
  1207. X
  1208. X    case 'd': 
  1209. X            if (sh) {
  1210. X                uplim = diff ? 0 : MIN(s2->destruct, Max_destruct(s) - s->destruct);
  1211. X            lolim = -MIN(s->destruct, Max_destruct(s2) - s2->destruct);
  1212. X            } else {
  1213. X                uplim = MIN(p->info[Playernum-1].destruct, Max_destruct(s) - s->destruct);
  1214. X            lolim = -s->destruct;
  1215. X            }
  1216. X          proc = 1;
  1217. X          break;
  1218. X
  1219. X    case 'f': 
  1220. X            if (sh) {
  1221. X                uplim = diff ? 0.0 : MIN((int)s2->fuel, Max_fuel(s) - (int)s->fuel);
  1222. X            lolim = - MIN((int)s->fuel, Max_fuel(s2) - (int)s2->fuel);
  1223. X            } else {
  1224. X                uplim = MIN((int)p->info[Playernum-1].fuel, Max_fuel(s) - (int)s->fuel);
  1225. X            lolim = -(int)s->fuel;
  1226. X            }
  1227. X          proc = 1;
  1228. X          break;
  1229. X
  1230. X    case 'r': 
  1231. X            if (sh) {
  1232. X                if (s->type==STYPE_SHUTTLE)
  1233. X              uplim = diff ? 0 : s2->resource;
  1234. X            else
  1235. X              uplim = diff ? 0 : MIN(s2->resource, Max_resource(s) - s->resource);
  1236. X            if (s2->type==STYPE_SHUTTLE)
  1237. X              lolim = -s->resource;
  1238. X            else
  1239. X              lolim = - MIN(s->resource, Max_resource(s2) - s2->resource);
  1240. X            } else {
  1241. X                uplim = MIN(p->info[Playernum-1].resource, Max_resource(s) - s->resource);
  1242. X            lolim = -s->resource;
  1243. X            }
  1244. X          proc = 1;
  1245. X          break;
  1246. X
  1247. X    default:
  1248. X        notify(Playernum, "No such commodity valid.\n");
  1249. X        if(sh)
  1250. X            free(s2);
  1251. X            else
  1252. X            free(p);
  1253. X        
  1254. X            free(s);
  1255. X        return;
  1256. X      }
  1257. X
  1258. Xif(amt<lolim || amt>uplim) {
  1259. X    sprintf(buf, "you can only transfer between %d and %d.\n", lolim, uplim);
  1260. X    notify(Playernum, buf);
  1261. X    free(s);
  1262. X
  1263. X    if(sh)
  1264. X        free(s2);
  1265. X    else
  1266. X        free(p);
  1267. X    
  1268. X    return;
  1269. X    }
  1270. X
  1271. Xopenracedata(&load_racedata);
  1272. Xgetrace(load_racedata, &Race, Playernum);
  1273. Xclose_file(load_racedata);
  1274. X    
  1275. Xif(amt==0) 
  1276. X    amt = uplim;
  1277. X
  1278. X    switch (commod) {
  1279. X
  1280. X      case 'c': 
  1281. X            if (sh) {
  1282. X                s2->popn -= amt;
  1283. X                s2->mass -= amt*Race->mass;
  1284. X                transfercrew = 1;
  1285. X            } else if(sect->owner && sect->owner != Playernum) {
  1286. X                   sprintf(buf,"That sector is already occupied by another player!\n");
  1287. X                notify(Playernum, buf);
  1288. X            transfercrew = 0;
  1289. X              } else { 
  1290. X            transfercrew = 1;
  1291. X                 if (!sect->popn && amt<0) {
  1292. X                p->info[Playernum-1].numsectsowned++;
  1293. X                sect->owner = Playernum;
  1294. X                sprintf(buf,"sector %.0f,%.0f COLONIZED.\n",s->xpos,s->ypos);
  1295. X                notify(Playernum, buf);
  1296. X                 }
  1297. X                 sect->popn -= amt;
  1298. X                 p->popn -= amt;
  1299. X                 if (sect->popn==0) {
  1300. X                p->info[Playernum-1].numsectsowned--;
  1301. X                sect->owner = 0;
  1302. X                sprintf(buf,"sector %.0f,%.0f evacuated.\n",s->xpos,s->ypos);
  1303. X                notify(Playernum, buf);
  1304. X                  }
  1305. X               }
  1306. X      if(transfercrew) {
  1307. X          sprintf(buf,"crew complement of ship #%d is now %u.\n", 
  1308. X            shipno, s->popn+amt);
  1309. X                notify(Playernum, buf);
  1310. X          s->popn += amt;
  1311. X          s->mass += amt*Race->mass;
  1312. X          Mod = 1;
  1313. X        }
  1314. X      break;
  1315. X
  1316. X    case 'd': s->destruct += amt;
  1317. X          s->mass += amt*MASS_DESTRUCT;
  1318. X        sprintf(buf, "%d destruct transferred.\n", amt);
  1319. X        notify(Playernum, buf);
  1320. X          if (!Max_crew(s)) {
  1321. X            sprintf(buf,"\n%s #%d ",Shipnames[s->type], shipno);
  1322. X                notify(Playernum, buf);
  1323. X            if (s->destruct) {
  1324. X                 sprintf(buf,"now boobytrapped.\n");
  1325. X            } else {
  1326. X                 sprintf(buf,"no longer boobytrapped.\n");
  1327. X             }
  1328. X                notify(Playernum, buf);
  1329. X            }
  1330. X
  1331. X          if (sh) {
  1332. X            s2->destruct -= amt;
  1333. X            s2->mass -= amt*MASS_DESTRUCT;
  1334. X          } else
  1335. X              p->info[Playernum-1].destruct -= amt;
  1336. X
  1337. X          Mod = 1;
  1338. X          break;
  1339. X
  1340. X    case 'x' :
  1341. X    case '&': 
  1342. X        s->crystals+= amt;
  1343. X        sprintf(buf, "%d crystal(s) transferred.\n", amt);
  1344. X        notify(Playernum, buf);
  1345. X
  1346. X          if (sh) {
  1347. X            s2->crystals -= amt;
  1348. X          } else p->info[Playernum-1].crystals -= amt;
  1349. X
  1350. X          Mod = 1;
  1351. X          break;
  1352. X
  1353. X    case 'f': s->fuel += amt*1.0;
  1354. X          s->mass += amt*MASS_FUEL;
  1355. X        sprintf(buf, "%d fuel transferred.\n", amt);
  1356. X        notify(Playernum, buf);
  1357. X
  1358. X          if (sh) {
  1359. X            s2->fuel -= amt*1.0;
  1360. X            s2->mass -= amt*MASS_FUEL;
  1361. X          } else p->info[Playernum-1].fuel -= amt*1.0;
  1362. X
  1363. X          Mod = 1;
  1364. X          break;
  1365. X
  1366. X    case 'r': s->resource += amt;
  1367. X          s->mass += amt*MASS_RESOURCE;
  1368. X        sprintf(buf, "%d resources transferred.\n", amt);
  1369. X        notify(Playernum, buf);
  1370. X
  1371. X          if (sh) {
  1372. X            s2->resource -= amt;
  1373. X            s2->mass -= amt*MASS_RESOURCE;
  1374. X          } else p->info[Playernum-1].resource -= amt;
  1375. X
  1376. X          Mod = 1;
  1377. X          break;
  1378. X
  1379. X    default:
  1380. X       notify(Playernum, "No such commodity.\n");
  1381. X    free(Race);
  1382. X    free(s);
  1383. X
  1384. X    if(sh)
  1385. X        free(s2);
  1386. X    else
  1387. X        free(p);
  1388. X    
  1389. X    return;
  1390. X    break;
  1391. X    }
  1392. X
  1393. X    openshdata(&load_shdata);
  1394. X    putship(load_shdata,s,shipno);
  1395. X    close_file(load_shdata);
  1396. X
  1397. X        if (s->type==OTYPE_TRANSDEV && s->object.number > 0) {
  1398. X
  1399. X       sprintf(buf,"Zap\07!\n");         /* ^G */
  1400. X                notify(Playernum, buf);
  1401. X
  1402. X           /* send stuff to other ship (could be transport device) */
  1403. X       if (s->resource ) {
  1404. X        s2->mass += s->resource * MASS_RESOURCE;
  1405. X        s2->resource += s->resource;
  1406. X
  1407. X        sprintf(buf,"%d resources transferred.\n", s->resource);
  1408. X                notify(Playernum, buf);
  1409. X        sprintf(bufr, "%d Resources\n",s->resource);
  1410. X
  1411. X        s->mass -= s->resource * MASS_RESOURCE;
  1412. X        s->resource  -= s->resource;
  1413. X       } else
  1414. X        bufr[0] = '\0';
  1415. X
  1416. X       if (s->fuel) {
  1417. X        s2->fuel += s->fuel;
  1418. X        s2->mass += s->fuel * MASS_FUEL;
  1419. X
  1420. X        sprintf(buf,"%g fuel transferred.\n", s->fuel);
  1421. X                notify(Playernum, buf);
  1422. X        sprintf(buff, "%g Fuel\n",s->fuel);
  1423. X
  1424. X        s->mass -= s->fuel * MASS_FUEL;
  1425. X        s->fuel -= s->fuel;
  1426. X       } else
  1427. X        buff[0] = '\0';
  1428. X
  1429. X       if (s->destruct) {
  1430. X        s2->mass += s->destruct * MASS_DESTRUCT;
  1431. X        s2->destruct += s->destruct;
  1432. X
  1433. X        sprintf(buf,"%d destruct transferred.\n", s->destruct);
  1434. X                notify(Playernum, buf);
  1435. X        sprintf(bufd, "%d Destruct\n",s->destruct);
  1436. X
  1437. X        s->mass -= s->destruct * MASS_DESTRUCT;
  1438. X        s->destruct -= s->destruct;
  1439. X       } else
  1440. X        bufd[0] = '\0';
  1441. X
  1442. X       if (s->popn) {
  1443. X        s2->mass += s->popn * Race->mass;
  1444. X        s2->popn += s->popn;
  1445. X
  1446. X        sprintf(buf,"%d population transferred.\n", s->popn);
  1447. X                notify(Playernum, buf);
  1448. X        sprintf(bufc, "%d %s\n",s->popn,Race->Thing?"tons of biomass" : "population");
  1449. X
  1450. X        s->mass -= s->popn * Race->mass;
  1451. X        s->popn -= s->popn;
  1452. X       } else
  1453. X        bufc[0] = '\0';
  1454. X
  1455. X       if (s->crystals) {
  1456. X        s2->crystals += s->crystals;
  1457. X
  1458. X        sprintf(buf,"%d crystal(s) transferred.\n", s->crystals);
  1459. X                notify(Playernum, buf);
  1460. X        sprintf(bufx, "%d crystal(s)\n",s->crystals);
  1461. X
  1462. X        s->crystals = 0;
  1463. X       } else
  1464. X        bufx[0] = '\0';
  1465. X
  1466. X         if (s2->owner!=s->owner) {
  1467. X       sprintf(telegram_buf,"BULLETIN!\n\n Audio-vibatory-physio-molecular transport device #");
  1468. X       sprintf(buf,"%d just gave your ship #%d the following:\n", shipno, s->object.number);
  1469. X        str_cat(telegram_buf, buf);
  1470. X        str_cat(telegram_buf, bufr);
  1471. X        str_cat(telegram_buf, bufd);
  1472. X        str_cat(telegram_buf, buff);
  1473. X        str_cat(telegram_buf, bufc);
  1474. X        str_cat(telegram_buf, bufx);
  1475. X        notify(s2->owner, telegram_buf);
  1476. X         }
  1477. X
  1478. X       openshdata(&load_shdata);
  1479. X       putship(load_shdata,s,shipno);
  1480. X       putship(load_shdata, s2, s->object.number);
  1481. X       close_file(load_shdata);
  1482. X        free(s2);
  1483. X    
  1484. X    } else if (sh) {
  1485. X        /* ship to ship transfer, non-transport device */
  1486. X
  1487. X    buff[0] = bufr[0] = bufd[0] = bufc[0] = '\0';
  1488. X    switch (commod) {
  1489. X        case 'r':
  1490. X            sprintf(buf,"%d resources transferred.\n", amt);
  1491. X                notify(Playernum, buf);
  1492. X            sprintf(bufr, "%d Resources\n",amt);
  1493. X            break;
  1494. X        case 'f':
  1495. X            sprintf(buf,"%d fuel transferred.\n", amt);
  1496. X                notify(Playernum, buf);
  1497. X            sprintf(buff, "%d Fuel\n",amt);
  1498. X            break;
  1499. X        case 'd':
  1500. X            sprintf(buf,"%d destruct transferred.\n", amt);
  1501. X                notify(Playernum, buf);
  1502. X            sprintf(bufd, "%d Destruct\n",amt);
  1503. X            break;
  1504. X        case 'x' :
  1505. X        case '&':
  1506. X            sprintf(buf,"%d crystals transferred.\n", amt);
  1507. X                notify(Playernum, buf);
  1508. X            sprintf(bufd, "%d Crystal(s)\n",amt);
  1509. X            break;
  1510. X        case 'c':
  1511. X            sprintf(buf,"%d popn transferred.\n", amt);
  1512. X                notify(Playernum, buf);
  1513. X            sprintf(bufc, "%d %s\n",amt,Race->Thing?"tons of biomass" : "population");
  1514. X            break;
  1515. X        default:
  1516. X            break;
  1517. X     }
  1518. X
  1519. X
  1520. X         if (s2->owner!=s->owner) {
  1521. X       sprintf(telegram_buf, "BULLETIN!\n\n Audio-vibatory-physio-molecular transport device #");
  1522. X       sprintf(buf,"%d just gave your ship #%d the following:\n", shipno, s->object.number);
  1523. X        str_cat(telegram_buf, buf);
  1524. X        str_cat(telegram_buf, bufr);
  1525. X        str_cat(telegram_buf, bufd);
  1526. X        str_cat(telegram_buf, buff);
  1527. X        str_cat(telegram_buf, bufc);
  1528. X        notify(s2->owner, telegram_buf);
  1529. X         }
  1530. X    openshdata(&load_shdata);
  1531. X    putship(load_shdata,s2,s->destshipno);
  1532. X    close_file(load_shdata);
  1533. X    free(s2);
  1534. X     }
  1535. X
  1536. X    if (!sh) {
  1537. X      if (commod=='c') {
  1538. X      opensectdata(&load_sectdata);
  1539. X      putsector(load_sectdata,sect,p->sectormappos + ( (int)s->ypos*p->Maxx+(int)s->xpos) * sizeof(sectortype) );
  1540. X        close_file(load_sectdata);
  1541. X    free(sect);
  1542. X    }
  1543. X      
  1544. X      openpdata(&load_pdata);
  1545. X       putplanet(load_pdata,p,Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
  1546. X       close_file(load_pdata);
  1547. X       free(p);
  1548. X     }
  1549. X
  1550. X    if (Mod && first) {
  1551. X         first = 0;
  1552. X         if (s->whatorbits==LEVEL_UNIV)
  1553. X        deductAPs(Playernum,APcount, 0, 1);    /* ded from sdata */
  1554. X         else 
  1555. X        deductAPs(Playernum,APcount, s->storbits, 0);
  1556. X
  1557. X    }
  1558. X
  1559. Xfree(s);
  1560. Xfree(Race);
  1561. X}
  1562. X
  1563. Xdump(Playernum,APcount, argn,args)
  1564. Xint Playernum;
  1565. Xint APcount;
  1566. Xint argn;
  1567. Xchar args[MAXARGS][COMMANDSIZE];
  1568. X{
  1569. Xint player, star, i;
  1570. Xracetype *Race, *r;
  1571. X
  1572. X    if (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1], APcount))
  1573. X            return;
  1574. X
  1575. X    GetPlayer(args[1], &player, &r);
  1576. Xif(player < 0 || player > Numraces() ) {
  1577. X  sprintf(buf,"No such player.\n");
  1578. X        notify(Playernum, buf);
  1579. X  return;
  1580. X    }
  1581. X
  1582. X/* transfer all planet and star knowledge to the player */
  1583. X/* get all stars and planets */
  1584. Xopenracedata(&load_racedata);
  1585. Xgetrace(load_racedata, &Race, Playernum);
  1586. Xclose_file(load_racedata);
  1587. X
  1588. X openstardata(&load_stardata);
  1589. X getsdata(load_stardata,&Sdata);
  1590. X openpdata(&load_pdata);
  1591. X for (star=0; star<Sdata.numstars; star++) {
  1592. X    free(Stars[star]);
  1593. X     getstar(load_stardata, &Stars[star], star);
  1594. X
  1595. X    if(isset(Stars[star]->explored, Playernum)) {
  1596. X            setbit(Stars[star]->explored, player);
  1597. X
  1598. X     for (i=0; i<Stars[star]->numplanets; i++) {
  1599. X        free(planets[star][i]);
  1600. X        getplanet(load_pdata,&planets[star][i],Stars[star]->planetpos[i]);
  1601. X        if(planets[star][i]->info[Playernum-1].explored) {
  1602. X        planets[star][i]->info[player-1].explored = 1;
  1603. X            putplanet(load_pdata,planets[star][i],Stars[star]->planetpos[i]);
  1604. X        }
  1605. X    }
  1606. X            putstar(load_stardata, Stars[star], star);
  1607. X}
  1608. X
  1609. X} 
  1610. Xclose_file(load_stardata);
  1611. Xclose_file(load_pdata);
  1612. X        deductAPs(Playernum,APcount, Dir[Playernum-1].snum, 0);
  1613. X
  1614. Xsprintf(buf, "%s [%d] has given you exploration data.\n", Race->name, Playernum);
  1615. Xif(!notify(player, buf))
  1616. X    push_message(TELEG_PLAYER_AUTO, player, buf, TELEGRAM);
  1617. Xnotify(Playernum, "Exploration Data transferred.\n");
  1618. X
  1619. Xfree(r);
  1620. Xfree(Race);
  1621. X}
  1622. X
  1623. Xtransfer(Playernum,APcount, argn,args)
  1624. Xint Playernum;
  1625. Xint APcount;
  1626. Xint argn;
  1627. Xchar args[MAXARGS][COMMANDSIZE];
  1628. X{
  1629. Xint Mod = 0, transfer_fd, player, give;
  1630. Xplanettype *planet;
  1631. Xchar commod=0;
  1632. Xracetype *r;
  1633. X
  1634. X        if (Dir[Playernum-1].level != LEVEL_PLAN) {
  1635. X      sprintf(buf,"You need to be in planet scope to do this.\n");
  1636. X      notify(Playernum, buf);
  1637. X      return;
  1638. X          }
  1639. X
  1640. X
  1641. X    if (!enufAP(Playernum,Stars[Dir[Playernum-1].snum]->AP[Playernum-1], APcount))
  1642. X            return;
  1643. X
  1644. X    GetPlayer(args[1], &player, &r);
  1645. X
  1646. Xif(player < 0 || player > Numraces() ) {
  1647. X  sprintf(buf,"No such player.\n");
  1648. X        notify(Playernum, buf);
  1649. X  return;
  1650. X    }
  1651. X
  1652. X    openpdata(&transfer_fd);
  1653. X    getplanet(transfer_fd, &planet, Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
  1654. X    close_file(transfer_fd);
  1655. X
  1656. X    sscanf(args[2],"%c",&commod);
  1657. X        give = atoi(args[3]);
  1658. X
  1659. Xif(give < 0) {
  1660. X    notify(Playernum, "You must specify a positive amount.\n");
  1661. X    free(r);
  1662. X    free(planet);
  1663. X    return;
  1664. X    }
  1665. X
  1666. Xswitch(commod) {
  1667. X    case 'r' :
  1668. X       if(give > planet->info[Playernum-1].resource)
  1669. X    {
  1670. X      sprintf(buf,"You don't have %d on this planet.\n",give);
  1671. X        notify(Playernum, buf);
  1672. X    } else {
  1673. X      planet->info[Playernum-1].resource -= give;
  1674. X      planet->info[player-1].resource += give;
  1675. X      sprintf(buf,"%d resources transferred to player #%d\n",give,player);
  1676. X        notify(Playernum, buf);
  1677. X    }
  1678. X      break;
  1679. X    case 'x' :
  1680. X    case '&' :
  1681. X       if(give > planet->info[Playernum-1].crystals)
  1682. X    {
  1683. X      sprintf(buf,"You don't have %d on this planet.\n",give);
  1684. X        notify(Playernum, buf);
  1685. X    } else {
  1686. X      planet->info[Playernum-1].crystals -= give;
  1687. X      planet->info[player-1].crystals += give;
  1688. X      sprintf(buf,"%d crystal(s) transferred to player #%d\n",give,player);
  1689. X        notify(Playernum, buf);
  1690. X    }
  1691. X      break;
  1692. X    case 'f' :
  1693. X      if(give > planet->info[Playernum-1].fuel)
  1694. X    {
  1695. X      sprintf(buf,"You don't have %d fuel on this planet.\n",give);
  1696. X        notify(Playernum, buf);
  1697. X    } else {
  1698. X      planet->info[Playernum-1].fuel -= give;
  1699. X      planet->info[player-1].fuel += give;
  1700. X      sprintf(buf,"%d fuel transferred to player #%d\n",give,player);
  1701. X        notify(Playernum, buf);
  1702. X    }
  1703. X      break;
  1704. X    case 'd' :
  1705. X      if(give > planet->info[Playernum-1].destruct)
  1706. X    {
  1707. X      sprintf(buf,"You don't have %d destruct on this planet.\n",give);
  1708. X      notify(Playernum, buf);
  1709. X      } else {
  1710. X      planet->info[Playernum-1].destruct -= give;
  1711. X      planet->info[player-1].destruct += give;
  1712. X      sprintf(buf,"%d destruct transferred to player #%d\n",give,player);
  1713. X        notify(Playernum, buf);
  1714. X    }
  1715. X      break;
  1716. X    default :
  1717. X      sprintf(buf,"What?\n");
  1718. X        notify(Playernum, buf);
  1719. X    }
  1720. X
  1721. X    openpdata(&transfer_fd);
  1722. X        putplanet(transfer_fd, planet, Stars[Dir[Playernum-1].snum]->planetpos[Dir[Playernum-1].pnum]);
  1723. X        close_file(transfer_fd);
  1724. X
  1725. X
  1726. Xfree(r);
  1727. Xfree(planet);
  1728. XMod = 1;
  1729. X
  1730. X        deductAPs(Playernum,APcount, Dir[Playernum-1].snum, 0);
  1731. X
  1732. X}
  1733. X
  1734. Xmount(Playernum,APcount, argn,args, mnt)
  1735. Xint Playernum;
  1736. Xint APcount;
  1737. Xint argn;
  1738. Xchar args[MAXARGS][COMMANDSIZE];
  1739. Xint mnt;
  1740. X{
  1741. Xshiptype *ship;
  1742. X
  1743. Xif(Dir[Playernum-1].level != LEVEL_SHIP) {
  1744. X    notify(Playernum, "You have to change scope to the ship first.\n");
  1745. X    return;
  1746. X}
  1747. X
  1748. X     openshdata(&load_shdata);
  1749. X     if (!getship(load_shdata, &ship, Dir[Playernum-1].shipno)) {
  1750. X        sprintf(buf,"Illegal dir value.\n");
  1751. X        notify(Playernum, buf);
  1752. X        close_file(load_shdata);
  1753. X        return;
  1754. X    }
  1755. X    close_file(load_shdata);
  1756. X    if (testship(Playernum,ship, Dir[Playernum-1].shipno))
  1757. X        {
  1758. X            free(ship);
  1759. X            return;
  1760. X        }
  1761. X
  1762. Xif(!ship->hyper_drive.has) {
  1763. X    notify(Playernum, "This ship is not equipped with hyper-drive.\n");
  1764. X        free(ship);
  1765. X        return;
  1766. X        }
  1767. X
  1768. Xif(ship->hyper_drive.mounted && mnt) {
  1769. X    notify(Playernum, "You already have a crystal mounted.\n");
  1770. X        free(ship);
  1771. X        return;
  1772. X        } else if(!ship->hyper_drive.mounted && !mnt) {
  1773. X    notify(Playernum, "You don't have a crystal mounted.\n");
  1774. X        free(ship);
  1775. X        return;
  1776. X        } else if(!ship->hyper_drive.mounted && mnt) {
  1777. X            if(!ship->crystals) {
  1778. X                notify(Playernum, "You have no crystals on board.\n");
  1779. X                free(ship);
  1780. X                return;
  1781. X            }
  1782. X            ship->hyper_drive.mounted=1;
  1783. X            ship->crystals--;            
  1784. X        notify(Playernum, "Mounted.\n");
  1785. X        } else if(ship->hyper_drive.mounted && !mnt) {
  1786. X            if(ship->crystals==Max_crystals(ship)) {
  1787. X                notify(Playernum, "You can't dismount the crystal. Max allowed already on board.\n");
  1788. X                free(ship);
  1789. X                return;
  1790. X                    }
  1791. X            ship->hyper_drive.mounted=0;
  1792. X            ship->crystals++;            
  1793. X            notify(Playernum, "Dismounted.\n");
  1794. X        if(ship->hyper_drive.charge | ship->hyper_drive.ready) {
  1795. X        ship->hyper_drive.charge=0;
  1796. X        ship->hyper_drive.ready=0;
  1797. X        notify(Playernum, "Discharged.\n");
  1798. X        }
  1799. X        if(ship->laser && ship->fire_laser) {
  1800. X        ship->fire_laser = 0;
  1801. X        notify(Playernum, "Laser deactivated.\n");
  1802. X        }
  1803. X
  1804. X            } else {
  1805. X    notify(Playernum, "Weird error in 'mount'.\n");
  1806. X        free(ship);
  1807. X        return;
  1808. X        }
  1809. X
  1810. X         openshdata(&load_shdata);
  1811. X        putship(load_shdata, ship, Dir[Playernum-1].shipno);
  1812. X    close_file(load_shdata);
  1813. X
  1814. Xfree(ship);
  1815. X}
  1816. END_OF_FILE
  1817. if test 20187 -ne `wc -c <'server/load.c'`; then
  1818.     echo shar: \"'server/load.c'\" unpacked with wrong size!
  1819. fi
  1820. # end of 'server/load.c'
  1821. echo shar: End of archive 1 \(of 9\).
  1822. cp /dev/null ark1isdone
  1823. MISSING=""
  1824. for I in 1 2 3 4 5 6 7 8 9 ; do
  1825.     if test ! -f ark${I}isdone ; then
  1826.     MISSING="${MISSING} ${I}"
  1827.     fi
  1828. done
  1829. if test "${MISSING}" = "" ; then
  1830.     echo You have unpacked all 9 archives.
  1831.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1832. else
  1833.     echo You still need to unpack the following archives:
  1834.     echo "        " ${MISSING}
  1835. fi
  1836. ##  End of shell archive.
  1837. exit 0
  1838.